import { createPinia } from 'pinia'
import 'virtual:svg-icons-register'
import { createApp } from 'vue'
import VueLazyload from 'vue-lazyload'
import App from './App.vue'
import VSvgIcon from './plugins/v-svg-icon'
import router from './router'
// UI组件
import MoodUI from './ui/index'
// UI样式
import './ui/styles/dist/index.css'

// 站点样式
import '@/assets/styles/dist/index.css'

// 动画库样式
import "animate.css"
import 'nprogress/nprogress.css'
import VWaterfall from './plugins/v-waterfall'

import directives from './directives'

import * as jQuery from 'jquery';

window['jQuery'] = window['$'] = jQuery;

const app = createApp(App)
const pinia = createPinia();

directives.install(app)

app.use(pinia)
    .use(router)
    .use(MoodUI)
    .use(VSvgIcon)
    .use(VWaterfall)
    .use(VueLazyload, {
        preLoad: 1.3,
        error: new URL('./assets/img/error-img.png', import.meta.url).href,
        loading: new URL('./assets/img/loading-img.gif', import.meta.url).href,
        attempt: 1
    })

app.mount('#app')

export {
    app, pinia
}

